import { createSSRApp } from "vue";
import App from "./App.vue";
import ElementPlusX from 'vue-element-plus-x'
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import { ElMessage } from 'element-plus';

import router from './routers';
import store from './stores';

import 'element-plus/dist/index.css';
import './styles/index.scss';

export function createApp() {
  const app = createSSRApp(App);
  app.use(router);
  app.use(store);
  app.use(ElMessage);
  app.use(ElementPlusX);
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
  }
  return {
    app,
	ElementPlusX,
  };

}
